-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hamcrest Is
matcher from core
#498
Hamcrest Is
matcher from core
#498
Conversation
this testcase uses a different import for the is matcher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions could not be made:
- src/test/java/org/openrewrite/java/testing/datafaker/JavaFakerToDataFakerTest.java
- lines 19-18
- lines 33-32
Thanks for the helpful test to reproduce & pointing out the likely cause. We can either change the Java recipe, or run a declarative recipe before this change to get this to work, as indicated here. An addition of this recipe - org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.hamcrest.core.Is is(..)
fullyQualifiedTargetTypeName: org.hamcrest.Matchers As the very first recipe here would allow both rewrite-testing-frameworks/src/main/resources/META-INF/rewrite/hamcrest.yml Lines 41 to 46 in bcb4449
Might be worth exploring if there's similar cases that could benefit from such a standardization-ahead-of-migration as well, but optional for this PR. Thanks for helping figure this one out! |
Thanks for getting this started @timo-abele! I've moved the test and applied the above suggestion such that it now passes. Good to have this covered! |
this testcase uses a different import for the is matcher
What's changed?
added a testcase where the is matcher is imported via
import static org.hamcrest.core.Is.is;
What's your motivation?
Fix #497
Anything in particular you'd like reviewers to focus on?
Anyone you would like to review specifically?
Have you considered any alternatives or workarounds?
Any additional context
Checklist